home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / amos / amoslist-0295.lzh / AMOSLIST / text0272.txt < prev    next >
Encoding:
Text File  |  1995-03-01  |  1.3 KB  |  23 lines

  1. >   I have one other small problem (more an annoyance, really) in that
  2. > I use Input #1 at the start of the game to load in the 
  3. > level data which takes the form of several arrays of dimensions 
  4. > (40,40) or so, and it takes absolutely *ages*. Is there
  5. > any quicker way of loading variables from disk?  I have tried
  6. > moving the files to ram: first but this makes no substantial
  7. > speed difference from the hard drive. I dread to think
  8. > what it would be like off floppies.
  9.  
  10.     Oh yeah, there are MUCH better ways.  There's a whole lot of translation
  11. involved in the way you're doing it.  To store the values, poke them into a
  12. memory bank and BSave the bank's memory.  To retrieve it, Bload the file
  13. into a bank.  If you want to put the values back into variables, just use
  14. peek, deek or leek (depending on the size of your numbers) and put the values
  15. back into variables.  This storage reduces size and translation steps.  You
  16. could also use random access files which would probably be better yet.  If
  17. you have an array of integers, you can load and save REALLY fast by saving
  18. the block of memory directly to disk from the array (with BSAVE) and loading
  19. from disk into the arrays memory (with BLOAD).  I'm in quite a hurry now so
  20. if you need more explanation just let me know.
  21.                         -- Ben
  22.  
  23.